﻿using Domain.Entitys.Sinv;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EFCore.EntityConfigurations.Sinv
{
    public class Sinv_Sale_ReturnConfiguration : IEntityTypeConfiguration<Sinv_Sale_Return_Details>
    {
        public void Configure(EntityTypeBuilder<Sinv_Sale_Return_Details> builder)
        {
            builder.ToTable("sinv_sale_return_details");
            builder.HasKey(srd => srd.Sale_Return_Details_Id);
            builder.HasOne(srd => srd.Main)
                .WithMany(srd => srd.Details)
                .HasForeignKey(srd => srd.Sale_Return_Id);
        }
    }
}
